﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IL2LogParser
{
    public class MissionStats
    {
        public MissionStats()
        {
        }

        public string MissionName { get; set; }
        public string MissionMapName { get; set; }
        public int CloudType { get; set; }
        public int CloudHeight { get; set; }
        public DateTime MissionDateTime { get; set; }
        public decimal WindDirection { get; set; }
        public decimal WindSpeed { get; set; }
        public int Gust { get; set; }
        public int Turbulence { get; set; }
        public int GameType { get; set; }
        public string MissionFile { get; set; }
        public string MissionLogFile { get; set; }
        public DateTime MissionStartDateTime { get; set; }
        public DateTime MissionEndDateTime { get; set; }
        public void SaveData()
        {
            System.IO.StreamWriter file = new System.IO.StreamWriter(String.Format("{0}.sql", this.MissionName), true);
            string outputString = String.Format("SET DATEFORMAT ydm;\nInsert Into MissionDetails SELECT '{0}','{1}','{2}',{3},{4},{5},{6},{7},{8},'{9}','{10}'\n", this.MissionName, this.MissionDateTime, this.MissionMapName, this.CloudType, this.CloudHeight, this.Gust, this.Turbulence, this.WindDirection, this.WindSpeed, this.GameType, this.MissionStartDateTime);
            file.Write(outputString);
            file.Close();
        }
    }
}
